/**
 * Copyright (c) 快宝网络 kuaidihelp.com Co., Ltd. All Rights Reserved 禁止外泄以及用于其它的商业用途
 */

import { Request, Response } from 'express';
import { responseSuccess } from '../utils';
import type { ResponseItem } from '../utils';
import Mock from 'mockjs';

export default {
  // 全寄加盟商基础信息列表
  'POST /regiment/League/lists': (req: Request, res: Response) => {
    const data = Mock.mock({
      'list|1-10': [
        {
          league_id: '@id',
          user_id: '278',
          regiment_id: '164',
          create_time: '2023-03-13 09:38:56',
          update_time: '2023-03-13 09:38:56',
          league_name: '加盟商名称',
          'league_type|1': ['normal', 'special'],
          contacts_name: '联系人姓名',
          contacts_mobile: '13783636923',
          mobile: '137****6923',
          province: '上海市',
          city: '上海市',
          district: '徐汇区',
          town: '斜土路街道',
          province_code: '310000000000',
          city_code: '310100000000',
          district_code: '310104000000',
          town_code: '310104007000',
          address: '@county(true)',
          league_area:
            '[{"province":"上海市","province_code":"310000000000","city":"上海市","city_code":"310100000000","district":"黄浦区","district_code":"310101000000"},{"province":"上海市","province_code":"310000000000","city":"上海市","city_code":"310100000000","district":"徐汇区","district_code":"310104000000"},{"province":"上海市","province_code":"310000000000","city":"上海市","city_code":"310100000000","district":"长宁区","district_code":"310105000000"}]',
          // 'league_area|0-2': [
          //   {
          //     city: '上海市',
          //     city_code: '310100000000',
          //     district: '静安区',
          //     district_code: '310106000000',
          //     id: '1283',
          //     league_id: '1243417',
          //     province: '上海市',
          //     province_code: '310000000000',
          //   },
          // ],
        },
      ],
    });
    const result = {
      code: 0,
      msg: 'success',
      data: {
        ...data,
        total: data.list.length,
      },
    };
    return res.json(result);
  },
  'POST /regiment/League/add': (req: Request, res: Response) => responseSuccess(req, res),
  'POST /regiment/League/edit': (req: Request, res: Response) => responseSuccess(req, res),
  'POST /regiment/League/getMobileByRegiment': (req: Request, res: Response) => {
    const result: ResponseItem = {
      code: 0,
      msg: '成功',
      data: '13783636923',
    };
    return res.json(result);
  },
};
